﻿package com.tvein.web.swc.toolBar
{
	//flash
	import flash.display.MovieClip;
	import flash.display.StageAlign;
	import flash.display.StageScaleMode;
	import flash.events.Event;
	import flash.events.MouseEvent;
	import flash.filters.GlowFilter;
	//A3D
	//custom
//
	public class ToolBar extends MovieClip
	{
		public function ToolBar()
		{
			stage?init(null):addEventListener(Event.ADDED_TO_STAGE, init);
		}
		
		private function init(evt:Event):void
		{
			removeEventListener(Event.ADDED_TO_STAGE , init);
			addEventListener(Event.REMOVED_FROM_STAGE, _onRemoved);
			stage.addEventListener(Event.RESIZE, _resizeUI);
			
			stage.scaleMode = StageScaleMode.NO_SCALE;
			stage.align = StageAlign.TOP_LEFT;
			
			txtInfo.width = stage.stageWidth;
			
			txtInfo.selectable = false;
			txtInfo.mouseEnabled = false;
			txtInfo.wordWrap = true;
			txtInfo.multiline = true;
			
			_resizeUI();
		}
		
		public function ToolText(txt:String)
		{
			txtInfo.text = txt;
		}
		
		public function GetText():String
		{
			return txtInfo.text;
		}
		
		private function _resizeUI(evt:Event = null):void
		{
			txtInfo.width = stage.stageWidth;
		}
		
		private function _onRemoved(evt:Event):void
		{
			removeEventListener(Event.REMOVED_FROM_STAGE, _onRemoved);
			stage.removeEventListener(Event.RESIZE, _resizeUI);
		}
	}
}